package com.howard.service;

import java.util.List;

import com.howard.entity.User;
import com.howard.exception.ServiceException;

/**
 * user service
 *
 * @author Howard.He
 *
 */
public interface UserService {

	/**
	 * 查询所有用户
	 *
	 * @return
	 * @throws ServiceException
	 *
	 */
	List<User> searchUserForList() throws ServiceException;

	/**
	 * 根据主键查询用户
	 *
	 * @param id
	 * @return User
	 * @throws ServiceException
	 */
	User searchUserById(long id) throws ServiceException;

	/**
	 * 根据
	 *
	 * @param accountName
	 * @return User
	 * @throws ServiceException
	 */
	User searchUserByAccName(String accountName) throws ServiceException;

	/**
	 *
	 * 批量插入用户
	 *
	 * @param user
	 *            List<User>
	 * @return int[] ids
	 * @throws ServiceException
	 *
	 */
	int[] addBatchUsers(List<User> user) throws ServiceException;

	/**
	 * 插入用户
	 *
	 * @param user
	 *            User
	 * @return user id
	 * @throws ServiceException
	 */
	long addUser(User user) throws ServiceException;

	/**
	 * 删除用户
	 * @param userId
	 * @throws ServiceException
	 */
	void delUser(Long userId) throws ServiceException;
}
